import { ObjCreate } from "../common/ObjCreate";
import { GlobalStyle } from "../../../common/global/GlobalStyle";
import { PublicMessageConfig } from "../../resource/PublicMessageConfig";
type int = number;
//class BuildDescription
    
    export  class BuildDescription /* flash.display.Sprite */
    {
        constructor()
        {
            
            this.createChildren();
            return;
        }

        /* internal  */createChildren(): void
        {
            this._textField = ObjCreate.createTextField("", 2, 0, 297, 98, null, GlobalStyle.textFormat1);
            this._textField.wordWrap = true;
            this._textField.multiline = true;
            this._textField.filters = [];
            this._bmp = new Object /* flash.display.Bitmap */();
            addChild(this._bmp);
            return;
        }

        public ChangeToItem(arg1: int): void
        {
            var loc1=PublicMessageConfig.instance.getItemByName("Equipment", String(arg1));
            var loc2=loc1 ? loc1.text : "";
            this._textField.htmlText = "<textformat leading=\'3\' leftMargin=\'19\' indent=\'-19\'>" + loc2 + "</textformat>";
            this._textField.height = this._textField.textHeight + this._textField.numLines * 4;
            this._textField.defaultTextFormat = GlobalStyle.textFormat1;
            if (this._bmpd) 
            {
                this._bmpd.dispose();
                this._bmpd = null;
            }
            this._bmpd = new Object /* flash.display.BitmapData */(297, this.height, true, 0);
            this._bmpd.draw(this._textField);
            this._bmp.bitmapData = this._bmpd;
            return;
        }

        public /* override */ get height(): number
        {
            return this._textField.textHeight + 5;
        }

        /* internal */ /* var */_bmp: Object /* flash.display.Bitmap */;

        /* internal */ /* var */_bmpd: Object /* flash.display.BitmapData */;

        /* internal */ /* var */_textField: Object /* flash.text.TextField */;
    }
